package com.benz.order.util.animal;

public class AnimalTest {
    public static void main(String[] args) {
        Animal cat = new Cat();
        Animal dog = new Dog();
        //animalShout(cat);
        animalShout(dog);
    }
    public static void animalShout(Animal animal){
        //animal.shout();
        if(animal instanceof Cat){
            Cat cat = (Cat)animal;
            cat.shout();
            cat.sleep();
        }else {
            System.out.println("this ani    mal is not a Cat");
        }
        System.out.println(animal.toString());
    }
}
